﻿using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyCompanyName.AbpZeroTemplate.Gantt
{
    public partial class TaskInfo : General
    {
        public TaskInfo()
        {
            this.Draggable = true;
            this.Resizable = true;
            this.Assignments = new HashSet<Assignment>();
            this.Predecessors = new HashSet<Dependency>();
            this.Successors = new HashSet<Dependency>();
            this.ChildrenRaw = new HashSet<TaskInfo>();
            this.Segments = new HashSet<TaskSegment>();
            this.CreateOn = DateTime.Now;
        }

        public override int Id { get; set; }

        public Guid Guid { get; set; }

        public int ProjectId { get; set; }
        public string CreateBy { get; set; }
        public DateTime CreateOn { get; set; }

        public virtual Nullable<int> parentIdRaw { get; set; }
        public string Name { get; set; }
        public Nullable<System.DateTime> StartDate { get; set; }
        public Nullable<System.DateTime> EndDate { get; set; }
        public Nullable<decimal> Duration { get; set; }
        public string DurationUnit { get; set; }
        public Nullable<int> PercentDone { get; set; }
        public string SchedulingMode { get; set; }
        public Nullable<System.DateTime> BaselineStartDate { get; set; }
        public Nullable<System.DateTime> BaselineEndDate { get; set; }
        public Nullable<int> BaselinePercentDone { get; set; }
        public string Cls { get; set; }
        public Nullable<int> CalendarIdRaw { get; set; }
        public Nullable<int> index { get; set; }
        public bool expanded { get; set; }
        public Nullable<decimal> Effort { get; set; }
        public string EffortUnit { get; set; }
        public string Note { get; set; }
        public string ConstraintType { get; set; }
        public Nullable<System.DateTime> ConstraintDate { get; set; }
        public bool ManuallyScheduled { get; set; }
        public bool Draggable { get; set; }
        public bool Resizable { get; set; }
        public bool Rollup { get; set; }
        public bool ShowInTimeline { get; set; }
        public string Color { get; set; }

        //public int ProjectId { get; set; }

        public virtual ICollection<Assignment> Assignments { get; set; }
        //[ForeignKey("FromIdRaw")]
        public virtual ICollection<Dependency> Predecessors { get; set; }
        //[ForeignKey("ToIdRaw")]
        public virtual ICollection<Dependency> Successors { get; set; }
        [ForeignKey("parentIdRaw")]
        public virtual ICollection<TaskInfo> ChildrenRaw { get; set; }
        [ForeignKey("Id")]
        public virtual TaskInfo Parent { get; set; }
        [ForeignKey("CalendarIdRaw")]
        public virtual Calendar Calendar { get; set; }
        public virtual ICollection<TaskSegment> Segments { get; set; }
    }
}
